home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / compulse.swf / scripts / frame_5 / DoAction_2.as next >
Text File  |  2013-04-24  |  6KB  |  298 lines

  1. function getParTime(lev)
  2. {
  3.    parTime = parTimes[lev] - 1;
  4. }
  5. var levChoice = 1;
  6. onMouseDown = function()
  7. {
  8.    holdMouse;
  9. };
  10. onEnterFrame = function()
  11. {
  12.    checkHit = false;
  13.    i = 1;
  14.    while(i < 26)
  15.    {
  16.       if(_root["b" + i].hitTest(_root._xmouse,_root._ymouse))
  17.       {
  18.          blag._x = _xmouse;
  19.          blag._y = _ymouse;
  20.          blag._visible = true;
  21.          checkHit = true;
  22.          if(i < 10)
  23.          {
  24.             blag.lev.text = "0" + i;
  25.          }
  26.          else
  27.          {
  28.             blag.lev.text = i;
  29.          }
  30.          if(myTimes[i - 1] == 0)
  31.          {
  32.             blag.yTime.text = "X";
  33.          }
  34.          else if(myTimes[i - 1] < 10)
  35.          {
  36.             blag.yTime.text = "0" + myTimes[i - 1];
  37.          }
  38.          else
  39.          {
  40.             blag.yTime.text = myTimes[i - 1];
  41.          }
  42.          if(parTimes[i - 1] < 10)
  43.          {
  44.             blag.pTime.text = "0" + parTimes[i - 1];
  45.          }
  46.          else
  47.          {
  48.             blag.pTime.text = parTimes[i - 1];
  49.          }
  50.          if(proScores[i - 1] < 10)
  51.          {
  52.             blag.proTime.text = "0" + proScores[i - 1];
  53.          }
  54.          else
  55.          {
  56.             blag.proTime.text = proScores[i - 1];
  57.          }
  58.          if(myTimes[i - 1] == 0)
  59.          {
  60.             blag.gotoAndStop(1);
  61.          }
  62.          else if(myTimes[i - 1] <= parTimes[i - 1])
  63.          {
  64.             blag.gotoAndStop(3);
  65.          }
  66.          else if(myTimes[i - 1] > 0)
  67.          {
  68.             blag.gotoAndStop(2);
  69.          }
  70.          if(myTimes[i - 1] <= proScores[i - 1] && myTimes[i - 1] != 0)
  71.          {
  72.             blag.gotoAndStop(4);
  73.          }
  74.       }
  75.       i++;
  76.    }
  77.    if(!checkHit)
  78.    {
  79.       blag._visible = false;
  80.    }
  81. };
  82. stop();
  83. i = 1;
  84. while(i < 26)
  85. {
  86.    _root["b" + i].onMouseDown = function()
  87.    {
  88.       if(this.hitTest(_root._xmouse,_root._ymouse))
  89.       {
  90.          levChoice = Number(this._name.substr(1,2));
  91.          playAll = false;
  92.          whiteFade.play();
  93.       }
  94.    };
  95.    i++;
  96. }
  97. var ringsOnLevels = new Array();
  98. ringsOnLevels.push(0);
  99. ringsOnLevels.push(1);
  100. ringsOnLevels.push(2);
  101. ringsOnLevels.push(0);
  102. ringsOnLevels.push(1);
  103. ringsOnLevels.push(3);
  104. ringsOnLevels.push(0);
  105. ringsOnLevels.push(0);
  106. ringsOnLevels.push(1);
  107. ringsOnLevels.push(3);
  108. ringsOnLevels.push(1);
  109. ringsOnLevels.push(3);
  110. ringsOnLevels.push(0);
  111. ringsOnLevels.push(0);
  112. ringsOnLevels.push(1);
  113. ringsOnLevels.push(3);
  114. ringsOnLevels.push(2);
  115. ringsOnLevels.push(3);
  116. ringsOnLevels.push(3);
  117. ringsOnLevels.push(4);
  118. ringsOnLevels.push(4);
  119. ringsOnLevels.push(0);
  120. ringsOnLevels.push(4);
  121. ringsOnLevels.push(3);
  122. ringsOnLevels.push(4);
  123. var parTimes = new Array();
  124. parTimes.push(1);
  125. parTimes.push(1);
  126. parTimes.push(1);
  127. parTimes.push(1);
  128. parTimes.push(3);
  129. parTimes.push(3);
  130. parTimes.push(5);
  131. parTimes.push(3);
  132. parTimes.push(7);
  133. parTimes.push(10);
  134. parTimes.push(5);
  135. parTimes.push(4);
  136. parTimes.push(2);
  137. parTimes.push(6);
  138. parTimes.push(6);
  139. parTimes.push(7);
  140. parTimes.push(4);
  141. parTimes.push(4);
  142. parTimes.push(10);
  143. parTimes.push(20);
  144. parTimes.push(25);
  145. parTimes.push(10);
  146. parTimes.push(11);
  147. parTimes.push(25);
  148. parTimes.push(18);
  149. i = 0;
  150. while(i < parTimes.length)
  151. {
  152.    i++;
  153. }
  154. var parTimes = new Array();
  155. parTimes.push(2);
  156. parTimes.push(2);
  157. parTimes.push(2);
  158. parTimes.push(2);
  159. parTimes.push(4);
  160. parTimes.push(4);
  161. parTimes.push(6);
  162. parTimes.push(4);
  163. parTimes.push(8);
  164. parTimes.push(6);
  165. parTimes.push(6);
  166. parTimes.push(6);
  167. parTimes.push(3);
  168. parTimes.push(7);
  169. parTimes.push(7);
  170. parTimes.push(8);
  171. parTimes.push(5);
  172. parTimes.push(5);
  173. parTimes.push(10);
  174. parTimes.push(10);
  175. parTimes.push(10);
  176. parTimes.push(6);
  177. parTimes.push(7);
  178. parTimes.push(14);
  179. parTimes.push(12);
  180. var proScores = new Array();
  181. proScores.push(1);
  182. proScores.push(1);
  183. proScores.push(1);
  184. proScores.push(1);
  185. proScores.push(2);
  186. proScores.push(1);
  187. proScores.push(2);
  188. proScores.push(1);
  189. proScores.push(2);
  190. proScores.push(3);
  191. proScores.push(2);
  192. proScores.push(1);
  193. proScores.push(1);
  194. proScores.push(5);
  195. proScores.push(1);
  196. proScores.push(3);
  197. proScores.push(2);
  198. proScores.push(1);
  199. proScores.push(5);
  200. proScores.push(5);
  201. proScores.push(5);
  202. proScores.push(2);
  203. proScores.push(2);
  204. proScores.push(4);
  205. proScores.push(6);
  206. var myProgress = 0;
  207. tapper = true;
  208. i = 0;
  209. while(i < 25)
  210. {
  211.    if(myTimes[i] > 0)
  212.    {
  213.       _root["b" + (i + 1)].inside.gotoAndStop(2);
  214.       myProgress += 2;
  215.       if(myTimes[i] <= parTimes[i])
  216.       {
  217.          _root["b" + (i + 1)].inside.gotoAndStop(3);
  218.          myProgress += 2;
  219.       }
  220.       if(myTimes[i] <= proScores[i])
  221.       {
  222.          _root["b" + (i + 1)].inside.gotoAndStop(4);
  223.          myProgress += 4;
  224.       }
  225.    }
  226.    i++;
  227. }
  228. var combinedProScore = 0;
  229. var combinedParScore = 0;
  230. tempNumber = 0;
  231. i = 0;
  232. while(i < 25)
  233. {
  234.    if(myTimes[i] != 0)
  235.    {
  236.       tempNumber += myTimes[i];
  237.       combinedProScore += proScores[i];
  238.       combinedParScore += parTimes[i];
  239.    }
  240.    i++;
  241. }
  242. if(tempNumber > combinedProScore)
  243. {
  244.    totMe.totS.text = Math.abs(combinedProScore - tempNumber) + " over Pro Score";
  245. }
  246. else if(tempNumber < combinedProScore)
  247. {
  248.    totMe.totS.text = Math.abs(combinedProScore - tempNumber) + " under Pro Score";
  249. }
  250. else
  251. {
  252.    totMe.totS.text = "At Pro Score";
  253. }
  254. if(tempNumber > combinedParScore)
  255. {
  256.    totMe.totP.text = Math.abs(combinedParScore - tempNumber) + " over Par Score";
  257. }
  258. else if(tempNumber < combinedParScore)
  259. {
  260.    totMe.totP.text = Math.abs(combinedParScore - tempNumber) + " under Par Score";
  261. }
  262. else
  263. {
  264.    totMe.totP.text = "At Par Score";
  265. }
  266. if(tempNumber > 99)
  267. {
  268.    totMe.trippy.text = tempNumber;
  269. }
  270. else if(tempNumber > 9)
  271. {
  272.    totMe.trippy.text = "0" + tempNumber;
  273. }
  274. else
  275. {
  276.    totMe.trippy.text = "00" + tempNumber;
  277. }
  278. bg.gotoAndStop(myProgress + 1);
  279. if(myProgress >= 100)
  280. {
  281.    goodStar.gotoAndStop(2);
  282. }
  283. if(myProgress >= 200)
  284. {
  285.    goodStar2.gotoAndStop(2);
  286. }
  287. if(myProgress < 10)
  288. {
  289.    myProgressDisp = "0" + myProgress + "%";
  290. }
  291. else
  292. {
  293.    myProgressDisp = myProgress + "%";
  294. }
  295. myMenu.customItems[0].enabled = false;
  296. myMenu.customItems[1].enabled = false;
  297. myMenu.customItems[2].enabled = false;
  298.